window.App = require('app');

require('utils');
require('fields');
require('libs');

require('templates');
require('models');
require('vos');
require('controllers');
require('views');
//require('store');
require('router');
require('routes'); 

$.ajaxSetup({
	error: function(qXHR, textStatus) {
		if (textStatus == "error") {
			if (Code.NotSignon == $.parseJSON(qXHR.responseText).code) {
				User.signonWithToken();
			}			
		}
	}
});
	
$.cookie.defaults = { expires: 7, path: '/', domain: "192.168.1.228" };
App.phoneFormats = [
   Ember.Object.create({valuee: "mobiphone", label: "Mobile Phone"}),
   Ember.Object.create({valuee: "telphone",    label: "Telphone"})
];

App.initialize();
